<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/>
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="__STATIC__/web/js/rem.js"></script>
    <link rel="stylesheet" href="__STATIC__/web/css/public.css">
    <link rel="stylesheet" href="__STATIC__/web/css/team_detail.css">
    <script src="__STATIC__/web/js/jquery.js"></script>
    <title>团队详情</title>
</head>

<body>
<div class="header">
    <if condition="$uid eq null">
        <a href="{:url('login/login')}">
            <img class="login-user" src="__STATIC__/web/img/login_user.png" />
        </a>
        <else/>
        <div class="login">
            <a href="{:url('me/me')}">
                <img class="login-user" src="__STATIC__/web/img/login_user.png" />
            </a>
        </div>
    </if>
    <img class="logo" src="__STATIC__/web/img/logo_white.png"/>
</div>
<div class="have">
    <div class="intro">
        <div class="title">{$team.team_name}</div>
        <div class="sort">
            {$team.keywords}
        </div>
        <div class="team-lists">
            主要成员：{$team.main_member}
        </div>
        <if condition="$uid neq null">
            <if condition="$collection neq null">
                <div class="collect" id="collect">
                    <img id="collect-img" src="__STATIC__/web/img/collected.png">
                    <div id="collect-text">已收藏</div>
                </div>
                <else/>
                <div class="collect" id="collect">
                    <img id="collect-img" src="__STATIC__/web/img/collect.png">
                    <div id="collect-text">点击收藏</div>
                </div>
            </if>
        </if>

    </div>
    <div class="team">
        <div class="team-title">团队简介</div>
        <div class="team-desc">{$team.content}</div>
    </div>
    <div class="result">
        <div class="result-title">研究方向及主要成果</div>
        <div class="result-desc">
            {$team.specialty}
        </div>
    </div>
    <div class="team-list">
        <div class="team-intro">团队成员简介</div>
        <ul class="team-list">
            <li>
                <a href="{:url('people/talentsDetail')}?id={$team.founder}">
                    <img src="{$team.team_pic}"/>
                    <div class="from" style="-webkit-box-orient: vertical;">{$team.team_name}</div>
                    <div class="principal" style="-webkit-box-orient: vertical;">负责人：{$team.founder_name}</div>
                </a>
            </li>
            <foreach name="team_members" item="vo">
                <li>
                    <a href="">
                        <img src="{$vo.head_img}"/>
                        <div class="from" style="-webkit-box-orient: vertical;">{$team.team_name}</div>
                        <div class="principal" style="-webkit-box-orient: vertical;">负责人：{$vo.name}</div>
                    </a>
                </li>
            </foreach>
            <div style="width: 1.92rem"></div>
            <div style="width: 1.92rem"></div>
        </ul>
    </div>
</div>
<div class="nohave">
    <img src="__STATIC__/web/img/noteam.png" alt="">
    <div>您还没有团队，请先去PC端创建团队</div>
</div>
<footer>
    <div class="bottom-bar">
        <div>Copyright©2019 　山东科技大学</div>
        <div>鲁ICP备09051012号</div>
    </div>
</footer>
<script>
    var isClick = !!`{$collection.id}` ? false : true;
    $('#collect').click(function () {
        if (isClick == true) {
            isClick = false;
            $.post('collect', {type: 4, cid: `{$team.id}`}, function (res) {
                if (res.code == 0) {
                    return layer.msg(res.msg)
                } else {
                    $('#collect-text').text('已收藏');
                    $('#collect-img').attr('src', '__STATIC__/web/img/collected.png');
                }
            })

        }
        else if (isClick == false) {
            isClick = true;
            $.post('uncollect', {type: 4, cid: `{$team.id}`}, function (res) {
                if (res.code == 0) {
                    return layer.msg(res.msg)
                } else {
                    $('#collect-text').text('点击收藏');
                    $('#collect-img').attr('src', '__STATIC__/web/img/collect.png');
                }
            })

        }
    })
</script>
</body>

</html>